package com.glb.gilibuy.service;

import com.github.pagehelper.PageInfo;
import com.glb.gilibuy.entity.Cart;
import com.glb.gilibuy.entity.UserOrder;
import com.glb.gilibuy.entity.UserReceiveAddress;
import com.glb.gilibuy.web.vo.CartVO;

import java.util.List;
import java.util.Map;

/**
 * @Description:
 * @Author: Yingtian qian
 * @Date: 2021/8/6 9:17
 */
public interface OrderService {

    /**
     * @Description: 基础Dao方法：根据用户id获取订单列表
     * @param:
     * @return:
     */
    List<UserOrder> selectOrdersByUserId(String userId);

    /**
     * @Description: 基础Dao方法：根据订单id获取单个订单信息
     * @param:
     * @return:
     */
    UserOrder selectOrderByOrderId(String orderId);

    Map<String, Object> createOrder(Map<String, Object> cartRes, String addressId, String userId);

    List<UserOrder> selectOrdersByUserIdAndState(String userId, Integer state);

    PageInfo findOrdersByUserIdAndState(String userId, Integer state);

    Map<String, Object> cancelOrder(UserOrder userOrder);

    /**
     * @Description: 更新订单信息（内部使用）
     * @param: userOrder 订单
     * @return:
     */
    Map<String, Object> updateOrder(UserOrder userOrder);

    Map<String, Object> confirmOrder(UserOrder userOrder);

    Map<String, Object> getOrder(UserOrder userOrder);

    /**
     * @Description: 存储一个订单 【过时的方法】
     * @param: userOrder 订单
     * @return:
     */
    UserOrder addOrder(UserOrder userOrder);

    /**
     * @Description: 订单添加物流单号 【过时的方法】
     * @param: String orderId订单号, String trackingNumber快递单号
     * @return:
     */
    int addTrackingNumberToOrder(String orderId, String trackingNumber);

    List<UserOrder> findALLOrder();


}
